<?php

/**
 * Created by PhpStorm.
 * User: Yieong
 * Date: 16/4/1
 * Time: 下午1:43
 */
class GuildController extends AdminBaseController {

    public function index(){
        $this->setTitle('家族信息查询');

        $server = $this->R('server');
        $search = $this->R('search');

        $platform = PubBase::getCurrentPlatform();
        $game = PubBase::getCurrentGame();
        $serverList = ServerService::getOptions($platform, $game);
        if(empty($server)){
            $server = key($serverList);
        }
        $this->out['serverList'] = $serverList;

        if(!empty($search)){
            $this->out['server'] = $server;
            $this->out['search'] = $search;
            $this->out['info'] = GuildService::getInfo($server, $search);
        }
    }

}